package cn.gjculture.shopping.api.dao;

import cn.gjculture.shopping.api.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface UserDao {

    @Insert("insert into user(userId,userName,insertTime,updateTime,status " +
            "values(#{userId},#{userName},#{insertTime},#{updateTime},#{status})" )
    int insert(User user);

    @Select("select * from user")
    List<User> query();

    @Select("select * from user where userId=#{userId}")
    User queryById(String userId);
    @Select("select * from user where userName=#{name}")
    User queryByName(String name);

    @Update("update `user` set password=#{password} where userId=#{userId} ")
    int updatePassword(User user);
}
